package com.ruoyi.visitor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.visitor.domain.VisitorAppointmentStaff;
import com.ruoyi.visitor.mapper.VisitorAppointmentStaffMapper;
import com.ruoyi.visitor.service.IVisitorAppointmentStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 随访人员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-01
 */
@Service
public class VisitorAppointmentStaffServiceImpl implements IVisitorAppointmentStaffService
{
    @Autowired
    private VisitorAppointmentStaffMapper visitorAppointmentStaffMapper;

    /**
     * 查询随访人员
     * 
     * @param id 随访人员主键
     * @return 随访人员
     */
    @Override
    public VisitorAppointmentStaff selectVisitorAppointmentStaffById(Long id)
    {
        return visitorAppointmentStaffMapper.selectVisitorAppointmentStaffById(id);
    }

    /**
     * 查询随访人员列表
     * 
     * @param visitorAppointmentStaff 随访人员
     * @return 随访人员
     */
    @Override
    public List<VisitorAppointmentStaff> selectVisitorAppointmentStaffList(VisitorAppointmentStaff visitorAppointmentStaff)
    {
        return visitorAppointmentStaffMapper.selectVisitorAppointmentStaffList(visitorAppointmentStaff);
    }

    /**
     * 新增随访人员
     * 
     * @param visitorAppointmentStaff 随访人员
     * @return 结果
     */
    @Override
    public int insertVisitorAppointmentStaff(VisitorAppointmentStaff visitorAppointmentStaff)
    {
        visitorAppointmentStaff.setCreateTime(DateUtils.getNowDate());
        return visitorAppointmentStaffMapper.insertVisitorAppointmentStaff(visitorAppointmentStaff);
    }

    /**
     * 修改随访人员
     * 
     * @param visitorAppointmentStaff 随访人员
     * @return 结果
     */
    @Override
    public int updateVisitorAppointmentStaff(VisitorAppointmentStaff visitorAppointmentStaff)
    {
        visitorAppointmentStaff.setUpdateTime(DateUtils.getNowDate());
        return visitorAppointmentStaffMapper.updateVisitorAppointmentStaff(visitorAppointmentStaff);
    }

    /**
     * 批量删除随访人员
     * 
     * @param ids 需要删除的随访人员主键
     * @return 结果
     */
    @Override
    public int deleteVisitorAppointmentStaffByIds(String ids)
    {
        return visitorAppointmentStaffMapper.deleteVisitorAppointmentStaffByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除随访人员信息
     * 
     * @param id 随访人员主键
     * @return 结果
     */
    @Override
    public int deleteVisitorAppointmentStaffById(Long id)
    {
        return visitorAppointmentStaffMapper.deleteVisitorAppointmentStaffById(id);
    }
}
